package com.tenentia.pcmps.swm.data.implementation;

import org.apache.log4j.Logger;

import com.tenentia.pcmps.swm.business.implementation.PersonsManagerImpl;
import com.tenentia.pcmps.swm.data.DataAccessException;
import com.tenentia.pcmps.swm.data.beans.Bonus;
import com.tenentia.pcmps.swm.data.interfaces.BonusDAO;
import com.tenentia.pcmps.swm.data.util.IBatisUtilities;

/**
 * 
 * @author tEnEntia, S.L.N.E.
 * 
 */
public class BonusDAOImpl implements BonusDAO {

	private static final Logger LOGGER = Logger.getLogger(PersonsManagerImpl.class.getPackage().getName());
	
	public BonusDAOImpl() {
		super();
	}

	@Override
	public Bonus getBonusByAge(Bonus bonus) throws DataAccessException {

		try {
			bonus = (Bonus) IBatisUtilities.getSqlMapClient().queryForObject("getBonusByAge", bonus);
			LOGGER.debug(bonus);
		} catch (Exception e) {
			LOGGER.error(e, e);
			throw new DataAccessException(e);
		}

		return bonus;
	}

}
